/*
 * MDIChild.java
 *
 * Created on 23 de enero de 2005, 16:21
 */

package demo;

import java.awt.*;
import javax.swing.*;

public class MDIChild extends JInternalFrame {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static final int SEPARACION = 24;
	static int inset = 0;
	private MDI mdi;

    public MDIChild(MDI mdi) {
        super(null,true,true,true,true);
        this.mdi = mdi;
        inicializar();
        setLocation(SEPARACION*inset, SEPARACION*inset);
        ++inset;
    }
    
    private void inicializar() {
        setName("mdiChild");
        int chWidth = (int) mdi.getWidth()*55/100;
        int chHeight = (int) mdi.getHeight()*50/100;
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-chWidth)/2, (screenSize.height-chHeight)/2, chWidth, chHeight);
     }

 
    
}
